package demo2;

import java.util.Comparator;

class Alg <E extends Comparable<E>> {
    public E findmax (E[] array) {
        E max = array[0];
        for (int i = 1; i < array.length; i++) {
            if (max.compareTo(array[i]) < 0) {
                max = array[i];
            }
        }
        return max;
    }

}


public class Test {
    public static void main(String[] args) {
        Alg<Integer> alg = new Alg<>();
        Integer[] integer = new Integer[]{1,2,3,4,5,33,5};
        //Double[] doubles = new Double[]{1.2,123.123};
        System.out.println(alg.findmax(integer));

    }
}
